#include <stdio.h>

struct Student {
  int id;
  char name[20];
  float score;
};

int main(void) {
  struct Student s1, s2;
  // 注意：s1.name是一个字符数组，
  // 向scanf传入首地址即可
  printf("Input student1:");
  scanf("%d%s%f", &s1.id, s1.name, &s1.score);
  printf("Input student2:");
  scanf("%d%s%f", &s2.id, s2.name, &s2.score);
  struct Student output_s; // 存储成绩较高的学生
  if (s1.score > s2.score) {
    output_s = s1;
  } else {
    output_s = s2;
  }
  printf("ID=%d, name=%s, score=%f\n", output_s.id, output_s.name,
         output_s.score);
  return 0;
}
